/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aviso.controller;

import aviso.entity.util.LocaleService;
import javax.annotation.PreDestroy;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ApplicationScoped;

/**
 *
 * @author avgusti
 */
@ManagedBean
@ApplicationScoped
public class LocaleController {

    LocaleService ref = LocaleService.getInstance();

    /** Creates a new instance of LocaleController */
    public LocaleController() {
    }

    public String translate(String string) {
        
        return ref.translate(string);
    }
    public String translate(String string1,String string2) {
        
        return ref.translate(string1+string2);
    }
//    public String translate(String... strings) {
//        String res = "";
//        for (String s : strings) {
//            res += s;
//        }
//        return ref.translate(res);
//    }

    @PreDestroy
    public void stopServisce() {
        ref.destroy();
    }
}
